{% extends "help/index.html" %}


{% block contentblock %}
    <div class="article">
        <div class="title">
            <div class="title-text">下单购买<span
                    class="update-time"><i>更新时间:</i><i>2019-11-20</i></span></div>
        </div>
        <div class="content">
            <h2>下单购买</h2>
            <h3>接口</h3>
            <code>/baidu_dueros/add_order</code>
            <h5>参数</h5>
            <table>
                <thead>
                <th>位置</th>
                <th>字段名</th>
                <th>类型</th>
                <th>是否必填</th>
                <th>描述</th>
                <th>备注</th>
                </thead>
                <tbody>
                <tr>
                    <td>http header</td>
                    <td>Authorization</td>
                    <td>String</td>
                    <td>是</td>
                    <td>Bearer + 空格 + 生成的用户access token</td>
                    <td></td>
                </tr>
                <tr>
                    <td>http body</td>
                    <td>productId</td>
                    <td>String</td>
                    <td>是</td>
                    <td>专辑ID</td>
                    <td></td>
                </tr>
                </tbody>
            </table>
            <h4>返回值</h4>
            <table>
                <thead>
                <th>字段名</th>
                <th>类型</th>
                <th>必填</th>
                <th>描述</th>
                </thead>
                <tbody>
                <tr>
                    <td>errno</td>
                    <td>int</td>
                    <td>是</td>
                    <td>错误码</td>
                </tr>
                <tr>
                    <td>message</td>
                    <td>String</td>
                    <td>是</td>
                    <td>接口返回状态的描述信息</td>
                </tr>
                <tr>
                    <td>data</td>
                    <td>String</td>
                    <td>是</td>
                    <td>内容json</td>
                </tr>
                <tr>
                    <td>data.productId</td>
                    <td>String</td>
                    <td>是</td>
                    <td>商品ID，专辑ID</td>
                </tr>
                <tr>
                    <td>data.price</td>
                    <td>int</td>
                    <td>是</td>
                    <td>资源价格，单位分</td>
                </tr>
                <tr>
                    <td>data.discounted_price</td>
                    <td>int</td>
                    <td>是</td>
                    <td>资源折扣价格，单位分</td>
                </tr>
                <tr>
                    <td>data.orderId</td>
                    <td>String</td>
                    <td>是</td>
                    <td>资源方内部订单ID</td>
                </tr>
                </tbody>
            </table>
            <h4>示例</h4>
            <pre><code>
curl --dump-header - -H "Authorization: Bearer baidu" -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data "{\"productId\":\"100\",\"VipType\":0,\"VipName\":\"\"}" https://wweb.yourhost.com/baidu_dueros/add_order
{"errno": "10", "message": "user must login"}
curl --dump-header - -H "Authorization: Bearer Rj9tsh2nmHRupXckxBCTAM3sPbUgdA" -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data "{\"productId\":\"100\",\"VipType\":0,\"VipName\":\"\"}" https://wweb.yourhost.com/baidu_dueros/add_order
{"errno": "100", "message": "free album"}
curl --dump-header - -H "Authorization: Bearer Rj9tsh2nmHRupXckxBCTAM3sPbUgdA" -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data "{\"productId\":\"100\",\"VipType\":0,\"VipName\":\"\"}" https://wweb.yourhost.com/baidu_dueros/add_order
{
    "errno": "0",
    "message": "success",
    "data": {
        "discounted_price": 1,
        "orderId": "20191118212100338N407978",
        "price": 1,
        "productId": "100"
    }
}
            </code></pre>
        </div>
    </div>
{% endblock contentblock %}